import request from '@/utils/request'

// 查询工程项目列表
export function listProject(query) {
  return request({
    url: '/tender/project/list',
    method: 'get',
    params: query
  })
}

// 查询工程项目详细
export function getProject(id) {
  return request({
    url: '/tender/project/' + id,
    method: 'get'
  })
}

// 新增工程项目
export function addProject(data) {
  return request({
    url: '/tender/project',
    method: 'post',
    data: data
  })
}

// 修改工程项目
export function updateProject(data) {
  return request({
    url: '/tender/project',
    method: 'put',
    data: data
  })
}

// 删除工程项目
export function delProject(id) {
  return request({
    url: '/tender/project/' + id,
    method: 'delete'
  })
}

// 导出工程项目
export function exportProject(query) {
  return request({
    url: '/tender/project/export',
    method: 'get',
    responseType:'blob',
    params: query
  })
}

/**
 * 下拉列表获取所有的任务信息
 * @param {*} query 
 */
export function listTaskInfo(query) {
  return request({
    url: '/tender/projectTask/getListInfo',
    method: 'get',
    params: query
  })
}

  /**
   * 工程分类列表
   * @param {*} query 
   */
  export function listSortType(query) {
    return request({
      url: '/tender/projectSort/listSortType',
      method: 'get',
      params: query
    })
  }

   /**
   *  公司列表
   * @param {*} query 
   */
  export function getCompanyList(query) {
    return request({
      url: '/tender/company/getCompanyList',
      method: 'get',
      params: query
    })
  }
    
  // 上传excel
export function upload(query) {
  return request({
    url: '/tender/project/upload',
    method: 'get',
    params: query
  })
}

 // 底价生成
 export function reservePrice(query) {
  return request({
    url: '/tender/project/reservePrice',
    method: 'get',
    params: query
  })
}